/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Bone
 */
@Entity
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Holding.findAll", query = "SELECT h FROM Holding h")})
public class Holding implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    private Integer nome;
    @Column(name = "TIPO_LIGACAO")
    private Character tipoLigacao;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "PARTIC_CAPITAL_VOTANTE", precision = 18, scale = 6)
    private BigDecimal particCapitalVotante;
    @Column(name = "PARTIC_CAPITAL_TOTAL", precision = 18, scale = 6)
    private BigDecimal particCapitalTotal;
    @Column(length = 14)
    private String cnpj;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idHolding")
    private List<HoldingMatriz> holdingMatrizList;

    public Holding() {
    }

    public Holding(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getNome() {
        return nome;
    }

    public void setNome(Integer nome) {
        this.nome = nome;
    }

    public Character getTipoLigacao() {
        return tipoLigacao;
    }

    public void setTipoLigacao(Character tipoLigacao) {
        this.tipoLigacao = tipoLigacao;
    }

    public BigDecimal getParticCapitalVotante() {
        return particCapitalVotante;
    }

    public void setParticCapitalVotante(BigDecimal particCapitalVotante) {
        this.particCapitalVotante = particCapitalVotante;
    }

    public BigDecimal getParticCapitalTotal() {
        return particCapitalTotal;
    }

    public void setParticCapitalTotal(BigDecimal particCapitalTotal) {
        this.particCapitalTotal = particCapitalTotal;
    }

    public String getCnpj() {
        return cnpj;
    }

    public void setCnpj(String cnpj) {
        this.cnpj = cnpj;
    }

    @XmlTransient
    public List<HoldingMatriz> getHoldingMatrizList() {
        return holdingMatrizList;
    }

    public void setHoldingMatrizList(List<HoldingMatriz> holdingMatrizList) {
        this.holdingMatrizList = holdingMatrizList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Holding)) {
            return false;
        }
        Holding other = (Holding) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.Holding[ id=" + id + " ]";
    }
    
}
